package com.gome.axwl.aoc.common.enumCode;


import java.util.HashMap;

/**
 * @Author John LI
 */
public class DatabaseDeleteReturnCode {

    public static final int DELETE_OK = 1;

    public static final int DELETE_FAIL = 0;

    private int code;

    private String name;

    private String description;

    public DatabaseDeleteReturnCode(int code, String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }


    private static HashMap<Integer, DatabaseDeleteReturnCode> databaseReturnCodeList = new HashMap<Integer, DatabaseDeleteReturnCode>() {

        private static final long serialVersionUID = 1L;

        {
            // 自定义错误类型
            put(DELETE_OK, new DatabaseDeleteReturnCode(DELETE_OK, "删除返回字段", "删除成功"));
            put(DELETE_FAIL, new DatabaseDeleteReturnCode(DELETE_FAIL, "删除返回字段", "删除失败"));
        }
    };

    public static DatabaseDeleteReturnCode getDatabaseReturnCode(int code) {
        return databaseReturnCodeList.get(code);
    }
}